#include <iostream>
using namespace std;

class A {
    public:
    A() {}
    void print() {cout << i << endl ;}
    void set(int ii) {i = ii;} 
    private:

    int i;// declaration

};

//int A::i = 0;

int main() {
    A a, b;
    a.set(10);
    a.print();
}
// PS D:\download\cpp\lesson20-30> g++ .\main.cpp
// C:\Users\zhurui19\AppData\Local\Temp\ccRX9ep6.o:main.cpp:(.text$_ZN1AC1Ev[__ZN1AC1Ev]+0xb): undefined reference to `A::i'
// C:\Users\zhurui19\AppData\Local\Temp\ccRX9ep6.o:main.cpp:(.text$_ZN1A5printEv[__ZN1A5printEv]+0xa): 
// undefined reference to `A::i'
// C:\Users\zhurui19\AppData\Local\Temp\ccRX9ep6.o:main.cpp:(.text$_ZN1A3setEi[__ZN1A3setEi]+0xd): undefined reference to `A::i'
// collect2.exe: error: ld returned 1 exit status
// a.print();
// PS D:\download\cpp\lesson20-30> .\a.exe       
// 6422352